using System;
using System.ComponentModel;
using System.Threading;
using FU.Capstones.IMS.Web.Common.InventoryServiceProxy.DataContracts;
using FU.Capstones.IMS.Web.Common.InventoryServiceProxy.EventArgs;
using FU.Capstones.IMS.Web.Common.InventoryServiceProxy.Interfaces;
using FU.Capstones.IMS.Web.Common.InventoryServiceProxy.Respondents;

namespace FU.Capstones.IMS.Web.Common.InventoryServiceProxy.OperationContracts
{
    public partial class InventoryServiceClient
    {

        #region GetPartnerCollection

        public event EventHandler<CollectionFeedbackCompletedEventArgs<Partner>> GetPartnerCollectionCompleted;

        [EditorBrowsableAttribute(EditorBrowsableState.Advanced)]
        IAsyncResult IInventoryService.BeginGetPartnerCollection(bool isShowAll, AsyncCallback callback, object asyncState)
        {
            return Channel.BeginGetPartnerCollection(isShowAll, callback, asyncState);
        }

        [EditorBrowsableAttribute(EditorBrowsableState.Advanced)]
        CollectionFeedback<Partner> IInventoryService.EndGetPartnerCollection(IAsyncResult result)
        {
            return Channel.EndGetPartnerCollection(result);
        }

        private IAsyncResult OnBeginGetPartnerCollection(object[] inValues, AsyncCallback callback, object asyncState)
        {
            bool isShowAll = (bool)inValues[0];

            return ((IInventoryService)(this)).BeginGetPartnerCollection(isShowAll, callback, asyncState);
        }

        private object[] OnEndGetPartnerCollection(IAsyncResult result)
        {
            CollectionFeedback<Partner> retVal = ((IInventoryService)(this)).EndGetPartnerCollection(result);
            return new object[] { retVal };
        }

        private void OnGetPartnerCollectionCompleted(object state)
        {
            if ((GetPartnerCollectionCompleted != null))
            {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                GetPartnerCollectionCompleted(this, new CollectionFeedbackCompletedEventArgs<Partner>(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }

        public void GetPartnerCollectionAsync(bool isShowAll)
        {
            GetPartnerCollectionAsync(isShowAll, null);
        }

        public void GetPartnerCollectionAsync(bool isShowAll, object userState)
        {
            if ((onBeginGetPartnerCollectionDelegate == null))
            {
                onBeginGetPartnerCollectionDelegate = new BeginOperationDelegate(OnBeginGetPartnerCollection);
            }
            if ((onEndGetPartnerCollectionDelegate == null))
            {
                onEndGetPartnerCollectionDelegate = new EndOperationDelegate(OnEndGetPartnerCollection);
            }
            if ((onGetPartnerCollectionCompletedDelegate == null))
            {
                onGetPartnerCollectionCompletedDelegate = new SendOrPostCallback(OnGetPartnerCollectionCompleted);
            }
            InvokeAsync(onBeginGetPartnerCollectionDelegate, new object[] {
                    isShowAll}, onEndGetPartnerCollectionDelegate, onGetPartnerCollectionCompletedDelegate, userState);
        }

        private BeginOperationDelegate onBeginGetPartnerCollectionDelegate;

        private EndOperationDelegate onEndGetPartnerCollectionDelegate;

        private SendOrPostCallback onGetPartnerCollectionCompletedDelegate;

        private partial class InventoryServiceClientChannel
        {
            public IAsyncResult BeginGetPartnerCollection(bool isShowAll, AsyncCallback callback, object asyncState)
            {
                object[] _args = new object[1];
                _args[0] = isShowAll;

                IAsyncResult _result = BeginInvoke("GetPartnerCollection", _args, callback, asyncState);
                return _result;
            }

            public CollectionFeedback<Partner> EndGetPartnerCollection(IAsyncResult result)
            {
                object[] _args = new object[0];
                CollectionFeedback<Partner> _result = ((CollectionFeedback<Partner>)(EndInvoke("GetPartnerCollection", _args, result)));
                return _result;
            }
        }

        #endregion
        
        #region GetSinglePartner

        public event EventHandler<SingleFeedbackCompletedEventArgs<Partner>> GetSinglePartnerCompleted;

        [EditorBrowsableAttribute(EditorBrowsableState.Advanced)]
        IAsyncResult IInventoryService.BeginGetSinglePartner(int partnerID, AsyncCallback callback, object asyncState)
        {
            return Channel.BeginGetSinglePartner(partnerID, callback, asyncState);
        }

        [EditorBrowsableAttribute(EditorBrowsableState.Advanced)]
        SingleFeedback<Partner> IInventoryService.EndGetSinglePartner(IAsyncResult result)
        {
            return Channel.EndGetSinglePartner(result);
        }

        private IAsyncResult OnBeginGetSinglePartner(object[] inValues, AsyncCallback callback, object asyncState)
        {
            int partnerID = (int)inValues[0];

            return ((IInventoryService)(this)).BeginGetSinglePartner(partnerID, callback, asyncState);
        }

        private object[] OnEndGetSinglePartner(IAsyncResult result)
        {
            SingleFeedback<Partner> retVal = ((IInventoryService)(this)).EndGetSinglePartner(result);
            return new object[] { retVal };
        }

        private void OnGetSinglePartnerCompleted(object state)
        {
            if ((GetSinglePartnerCompleted != null))
            {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                GetSinglePartnerCompleted(this, new SingleFeedbackCompletedEventArgs<Partner>(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }

        public void GetSinglePartnerAsync(int partnerID)
        {
            GetSinglePartnerAsync(partnerID, null);
        }

        public void GetSinglePartnerAsync(int partnerID, object userState)
        {
            if ((onBeginGetSinglePartnerDelegate == null))
            {
                onBeginGetSinglePartnerDelegate = new BeginOperationDelegate(OnBeginGetSinglePartner);
            }
            if ((onEndGetSinglePartnerDelegate == null))
            {
                onEndGetSinglePartnerDelegate = new EndOperationDelegate(OnEndGetSinglePartner);
            }
            if ((onGetSinglePartnerCompletedDelegate == null))
            {
                onGetSinglePartnerCompletedDelegate = new SendOrPostCallback(OnGetSinglePartnerCompleted);
            }
            InvokeAsync(onBeginGetSinglePartnerDelegate, new object[] {
                                                                                  partnerID}, onEndGetSinglePartnerDelegate, onGetSinglePartnerCompletedDelegate, userState);
        }

        private BeginOperationDelegate onBeginGetSinglePartnerDelegate;

        private EndOperationDelegate onEndGetSinglePartnerDelegate;

        private SendOrPostCallback onGetSinglePartnerCompletedDelegate;

        private partial class InventoryServiceClientChannel
        {
            public IAsyncResult BeginGetSinglePartner(int partnerID, AsyncCallback callback, object asyncState)
            {
                object[] _args = new object[1];
                _args[0] = partnerID;

                IAsyncResult _result = BeginInvoke("GetSinglePartner", _args, callback, asyncState);
                return _result;
            }

            public SingleFeedback<Partner> EndGetSinglePartner(IAsyncResult result)
            {
                object[] _args = new object[0];
                SingleFeedback<Partner> _result = ((SingleFeedback<Partner>)(EndInvoke("GetSinglePartner", _args, result)));
                return _result;
            }
        }

        #endregion

        #region InsertPartner

        public event EventHandler<SingleFeedbackCompletedEventArgs<int>> InsertPartnerCompleted;

        [EditorBrowsableAttribute(EditorBrowsableState.Advanced)]
        IAsyncResult IInventoryService.BeginInsertPartner(Partner data, AsyncCallback callback, object asyncState)
        {
            return Channel.BeginInsertPartner(data, callback, asyncState);
        }

        [EditorBrowsableAttribute(EditorBrowsableState.Advanced)]
        SingleFeedback<int> IInventoryService.EndInsertPartner(IAsyncResult result)
        {
            return Channel.EndInsertPartner(result);
        }

        private IAsyncResult OnBeginInsertPartner(object[] inValues, AsyncCallback callback, object asyncState)
        {
            Partner data = (Partner)inValues[0];

            return ((IInventoryService)(this)).BeginInsertPartner(data, callback, asyncState);
        }

        private object[] OnEndInsertPartner(IAsyncResult result)
        {
            SingleFeedback<int> retVal = ((IInventoryService)(this)).EndInsertPartner(result);
            return new object[] { retVal };
        }

        private void OnInsertPartnerCompleted(object state)
        {
            if ((InsertPartnerCompleted != null))
            {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                InsertPartnerCompleted(this, new SingleFeedbackCompletedEventArgs<int>(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }

        public void InsertPartnerAsync(Partner data)
        {
            InsertPartnerAsync(data, null);
        }

        public void InsertPartnerAsync(Partner data, object userState)
        {
            if ((onBeginInsertPartnerDelegate == null))
            {
                onBeginInsertPartnerDelegate = new BeginOperationDelegate(OnBeginInsertPartner);
            }
            if ((onEndInsertPartnerDelegate == null))
            {
                onEndInsertPartnerDelegate = new EndOperationDelegate(OnEndInsertPartner);
            }
            if ((onInsertPartnerCompletedDelegate == null))
            {
                onInsertPartnerCompletedDelegate = new SendOrPostCallback(OnInsertPartnerCompleted);
            }
            InvokeAsync(onBeginInsertPartnerDelegate, new object[] {
                                                                               data}, onEndInsertPartnerDelegate, onInsertPartnerCompletedDelegate, userState);
        }

        private BeginOperationDelegate onBeginInsertPartnerDelegate;

        private EndOperationDelegate onEndInsertPartnerDelegate;

        private SendOrPostCallback onInsertPartnerCompletedDelegate;

        private partial class InventoryServiceClientChannel
        {
            public IAsyncResult BeginInsertPartner(Partner data, AsyncCallback callback, object asyncState)
            {
                object[] _args = new object[1];
                _args[0] = data;

                IAsyncResult _result = BeginInvoke("InsertPartner", _args, callback, asyncState);
                return _result;
            }

            public SingleFeedback<int> EndInsertPartner(IAsyncResult result)
            {
                object[] _args = new object[0];
                SingleFeedback<int> _result = ((SingleFeedback<int>)(EndInvoke("InsertPartner", _args, result)));
                return _result;
            }
        }

        #endregion

        #region UpdatePartner

        public event EventHandler<FeedbackCompletedEventArgs> UpdatePartnerCompleted;

        [EditorBrowsableAttribute(EditorBrowsableState.Advanced)]
        IAsyncResult IInventoryService.BeginUpdatePartner(Partner data, AsyncCallback callback, object asyncState)
        {
            return Channel.BeginUpdatePartner(data, callback, asyncState);
        }

        [EditorBrowsableAttribute(EditorBrowsableState.Advanced)]
        Feedback IInventoryService.EndUpdatePartner(IAsyncResult result)
        {
            return Channel.EndUpdatePartner(result);
        }

        private IAsyncResult OnBeginUpdatePartner(object[] inValues, AsyncCallback callback, object asyncState)
        {
            Partner data = (Partner)inValues[0];

            return ((IInventoryService)(this)).BeginUpdatePartner(data, callback, asyncState);
        }

        private object[] OnEndUpdatePartner(IAsyncResult result)
        {
            Feedback retVal = ((IInventoryService)(this)).EndUpdatePartner(result);
            return new object[] { retVal };
        }

        private void OnUpdatePartnerCompleted(object state)
        {
            if ((UpdatePartnerCompleted != null))
            {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                UpdatePartnerCompleted(this, new FeedbackCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }

        public void UpdatePartnerAsync(Partner data)
        {
            UpdatePartnerAsync(data, null);
        }

        public void UpdatePartnerAsync(Partner data, object userState)
        {
            if ((onBeginUpdatePartnerDelegate == null))
            {
                onBeginUpdatePartnerDelegate = new BeginOperationDelegate(OnBeginUpdatePartner);
            }
            if ((onEndUpdatePartnerDelegate == null))
            {
                onEndUpdatePartnerDelegate = new EndOperationDelegate(OnEndUpdatePartner);
            }
            if ((onUpdatePartnerCompletedDelegate == null))
            {
                onUpdatePartnerCompletedDelegate = new SendOrPostCallback(OnUpdatePartnerCompleted);
            }
            InvokeAsync(onBeginUpdatePartnerDelegate, new object[] {
                                                                               data}, onEndUpdatePartnerDelegate, onUpdatePartnerCompletedDelegate, userState);
        }

        private BeginOperationDelegate onBeginUpdatePartnerDelegate;

        private EndOperationDelegate onEndUpdatePartnerDelegate;

        private SendOrPostCallback onUpdatePartnerCompletedDelegate;

        private partial class InventoryServiceClientChannel
        {
            public IAsyncResult BeginUpdatePartner(Partner data, AsyncCallback callback, object asyncState)
            {
                object[] _args = new object[1];
                _args[0] = data;

                IAsyncResult _result = BeginInvoke("UpdatePartner", _args, callback, asyncState);
                return _result;
            }

            public Feedback EndUpdatePartner(IAsyncResult result)
            {
                object[] _args = new object[0];
                Feedback _result = ((Feedback)(EndInvoke("UpdatePartner", _args, result)));
                return _result;
            }
        }

        #endregion

        #region DeletePartner

        public event EventHandler<FeedbackCompletedEventArgs> DeletePartnerCompleted;

        [EditorBrowsableAttribute(EditorBrowsableState.Advanced)]
        IAsyncResult IInventoryService.BeginDeletePartner(int data, AsyncCallback callback, object asyncState)
        {
            return Channel.BeginDeletePartner(data, callback, asyncState);
        }

        [EditorBrowsableAttribute(EditorBrowsableState.Advanced)]
        Feedback IInventoryService.EndDeletePartner(IAsyncResult result)
        {
            return Channel.EndDeletePartner(result);
        }

        private IAsyncResult OnBeginDeletePartner(object[] inValues, AsyncCallback callback, object asyncState)
        {
            int data = (int)inValues[0];

            return ((IInventoryService)(this)).BeginDeletePartner(data, callback, asyncState);
        }

        private object[] OnEndDeletePartner(IAsyncResult result)
        {
            Feedback retVal = ((IInventoryService)(this)).EndDeletePartner(result);
            return new object[] { retVal };
        }

        private void OnDeletePartnerCompleted(object state)
        {
            if ((DeletePartnerCompleted != null))
            {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                DeletePartnerCompleted(this, new FeedbackCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }

        public void DeletePartnerAsync(int data)
        {
            DeletePartnerAsync(data, null);
        }

        public void DeletePartnerAsync(int data, object userState)
        {
            if ((onBeginDeletePartnerDelegate == null))
            {
                onBeginDeletePartnerDelegate = new BeginOperationDelegate(OnBeginDeletePartner);
            }
            if ((onEndDeletePartnerDelegate == null))
            {
                onEndDeletePartnerDelegate = new EndOperationDelegate(OnEndDeletePartner);
            }
            if ((onDeletePartnerCompletedDelegate == null))
            {
                onDeletePartnerCompletedDelegate = new SendOrPostCallback(OnDeletePartnerCompleted);
            }
            InvokeAsync(onBeginDeletePartnerDelegate, new object[] {
                                                                               data}, onEndDeletePartnerDelegate, onDeletePartnerCompletedDelegate, userState);
        }

        private BeginOperationDelegate onBeginDeletePartnerDelegate;

        private EndOperationDelegate onEndDeletePartnerDelegate;

        private SendOrPostCallback onDeletePartnerCompletedDelegate;

        private partial class InventoryServiceClientChannel
        {
            public IAsyncResult BeginDeletePartner(int data, AsyncCallback callback, object asyncState)
            {
                object[] _args = new object[1];
                _args[0] = data;

                IAsyncResult _result = BeginInvoke("DeletePartner", _args, callback, asyncState);
                return _result;
            }

            public Feedback EndDeletePartner(IAsyncResult result)
            {
                object[] _args = new object[0];
                Feedback _result = ((Feedback)(EndInvoke("DeletePartner", _args, result)));
                return _result;
            }
        }

        #endregion

        #region SearchPartner

        public event EventHandler<CollectionFeedbackCompletedEventArgs<Partner>> SearchPartnerCompleted;

        [EditorBrowsableAttribute(EditorBrowsableState.Advanced)]
        IAsyncResult IInventoryService.BeginSearchPartner(Partner criteria, AsyncCallback callback, object asyncState)
        {
            return Channel.BeginSearchPartner(criteria, callback, asyncState);
        }

        [EditorBrowsableAttribute(EditorBrowsableState.Advanced)]
        CollectionFeedback<Partner> IInventoryService.EndSearchPartner(IAsyncResult result)
        {
            return Channel.EndSearchPartner(result);
        }

        private IAsyncResult OnBeginSearchPartner(object[] inValues, AsyncCallback callback, object asyncState)
        {
            Partner criteria = (Partner)inValues[0];

            return ((IInventoryService)(this)).BeginSearchPartner(criteria, callback, asyncState);
        }

        private object[] OnEndSearchPartner(IAsyncResult result)
        {
            CollectionFeedback<Partner> retVal = ((IInventoryService)(this)).EndSearchPartner(result);
            return new object[] { retVal };
        }

        private void OnSearchPartnerCompleted(object state)
        {
            if ((SearchPartnerCompleted != null))
            {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                SearchPartnerCompleted(this, new CollectionFeedbackCompletedEventArgs<Partner>(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }

        public void SearchPartnerAsync(Partner criteria)
        {
            SearchPartnerAsync(criteria, null);
        }

        public void SearchPartnerAsync(Partner criteria, object userState)
        {
            if ((onBeginSearchPartnerDelegate == null))
            {
                onBeginSearchPartnerDelegate = new BeginOperationDelegate(OnBeginSearchPartner);
            }
            if ((onEndSearchPartnerDelegate == null))
            {
                onEndSearchPartnerDelegate = new EndOperationDelegate(OnEndSearchPartner);
            }
            if ((onSearchPartnerCompletedDelegate == null))
            {
                onSearchPartnerCompletedDelegate = new SendOrPostCallback(OnSearchPartnerCompleted);
            }
            InvokeAsync(onBeginSearchPartnerDelegate, new object[] {
                                                                               criteria}, onEndSearchPartnerDelegate, onSearchPartnerCompletedDelegate, userState);
        }

        private BeginOperationDelegate onBeginSearchPartnerDelegate;

        private EndOperationDelegate onEndSearchPartnerDelegate;

        private SendOrPostCallback onSearchPartnerCompletedDelegate;

        private partial class InventoryServiceClientChannel
        {
            public IAsyncResult BeginSearchPartner(Partner criteria, AsyncCallback callback, object asyncState)
            {
                object[] _args = new object[1];
                _args[0] = criteria;

                IAsyncResult _result = BeginInvoke("SearchPartner", _args, callback, asyncState);
                return _result;
            }

            public CollectionFeedback<Partner> EndSearchPartner(IAsyncResult result)
            {
                object[] _args = new object[0];
                CollectionFeedback<Partner> _result = ((CollectionFeedback<Partner>)(EndInvoke("SearchPartner", _args, result)));
                return _result;
            }
        }

        #endregion

        #region GetPartnerCollectionByParam

        public event EventHandler<CollectionFeedbackCompletedEventArgs<Partner>> GetPartnerCollectionByParamCompleted;

        [EditorBrowsableAttribute(EditorBrowsableState.Advanced)]
        IAsyncResult IInventoryService.BeginGetPartnerCollectionByParam(bool? isSupplier, AsyncCallback callback, object asyncState)
        {
            return Channel.BeginGetPartnerCollectionByParam(isSupplier, callback, asyncState);
        }

        [EditorBrowsableAttribute(EditorBrowsableState.Advanced)]
        CollectionFeedback<Partner> IInventoryService.EndGetPartnerCollectionByParam(IAsyncResult result)
        {
            return Channel.EndGetPartnerCollectionByParam(result);
        }

        private IAsyncResult OnBeginGetPartnerCollectionByParam(object[] inValues, AsyncCallback callback, object asyncState)
        {
            bool? isSupplier = (bool?)inValues[0];

            return ((IInventoryService)(this)).BeginGetPartnerCollectionByParam(isSupplier, callback, asyncState);
        }

        private object[] OnEndGetPartnerCollectionByParam(IAsyncResult result)
        {
            CollectionFeedback<Partner> retVal = ((IInventoryService)(this)).EndGetPartnerCollectionByParam(result);
            return new object[] { retVal };
        }

        private void OnGetPartnerCollectionByParamCompleted(object state)
        {
            if ((GetPartnerCollectionByParamCompleted != null))
            {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                GetPartnerCollectionByParamCompleted(this, new CollectionFeedbackCompletedEventArgs<Partner>(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }

        public void GetPartnerCollectionByParamAsync(bool? isSupplier)
        {
            GetPartnerCollectionByParamAsync(isSupplier, null);
        }

        public void GetPartnerCollectionByParamAsync(bool? isSupplier, object userState)
        {
            if ((onBeginGetPartnerCollectionByParamDelegate == null))
            {
                onBeginGetPartnerCollectionByParamDelegate = new BeginOperationDelegate(OnBeginGetPartnerCollectionByParam);
            }
            if ((onEndGetPartnerCollectionByParamDelegate == null))
            {
                onEndGetPartnerCollectionByParamDelegate = new EndOperationDelegate(OnEndGetPartnerCollectionByParam);
            }
            if ((onGetPartnerCollectionByParamCompletedDelegate == null))
            {
                onGetPartnerCollectionByParamCompletedDelegate = new SendOrPostCallback(OnGetPartnerCollectionByParamCompleted);
            }
            InvokeAsync(onBeginGetPartnerCollectionByParamDelegate, new object[] {
                    isSupplier}, onEndGetPartnerCollectionByParamDelegate, onGetPartnerCollectionByParamCompletedDelegate, userState);
        }

        private BeginOperationDelegate onBeginGetPartnerCollectionByParamDelegate;

        private EndOperationDelegate onEndGetPartnerCollectionByParamDelegate;

        private SendOrPostCallback onGetPartnerCollectionByParamCompletedDelegate;

        private partial class InventoryServiceClientChannel
        {
            public IAsyncResult BeginGetPartnerCollectionByParam(bool? isSupplier, AsyncCallback callback, object asyncState)
            {
                object[] _args = new object[1];
                _args[0] = isSupplier;

                IAsyncResult _result = BeginInvoke("GetPartnerCollectionByParam", _args, callback, asyncState);
                return _result;
            }

            public CollectionFeedback<Partner> EndGetPartnerCollectionByParam(IAsyncResult result)
            {
                object[] _args = new object[0];
                CollectionFeedback<Partner> _result = ((CollectionFeedback<Partner>)(EndInvoke("GetPartnerCollectionByParam", _args, result)));
                return _result;
            }
        }

        #endregion

        #region UndoDeletePartner

        public event EventHandler<FeedbackCompletedEventArgs> UndoDeletePartnerCompleted;

        [EditorBrowsableAttribute(EditorBrowsableState.Advanced)]
        IAsyncResult IInventoryService.BeginUndoDeletePartner(int objID, AsyncCallback callback, object asyncState)
        {
            return Channel.BeginUndoDeletePartner(objID, callback, asyncState);
        }

        [EditorBrowsableAttribute(EditorBrowsableState.Advanced)]
        Feedback IInventoryService.EndUndoDeletePartner(IAsyncResult result)
        {
            return Channel.EndUndoDeletePartner(result);
        }

        private IAsyncResult OnBeginUndoDeletePartner(object[] inValues, AsyncCallback callback, object asyncState)
        {
            int objID = (int)inValues[0];

            return ((IInventoryService)(this)).BeginUndoDeletePartner(objID, callback, asyncState);
        }

        private object[] OnEndUndoDeletePartner(IAsyncResult result)
        {
            Feedback retVal = ((IInventoryService)(this)).EndUndoDeletePartner(result);
            return new object[] { retVal };
        }

        private void OnUndoDeletePartnerCompleted(object state)
        {
            if ((UndoDeletePartnerCompleted != null))
            {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                UndoDeletePartnerCompleted(this, new FeedbackCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }

        public void UndoDeletePartnerAsync(int objID)
        {
            UndoDeletePartnerAsync(objID, null);
        }

        public void UndoDeletePartnerAsync(int objID, object userState)
        {
            if ((onBeginUndoDeletePartnerDelegate == null))
            {
                onBeginUndoDeletePartnerDelegate = new BeginOperationDelegate(OnBeginUndoDeletePartner);
            }
            if ((onEndUndoDeletePartnerDelegate == null))
            {
                onEndUndoDeletePartnerDelegate = new EndOperationDelegate(OnEndUndoDeletePartner);
            }
            if ((onUndoDeletePartnerCompletedDelegate == null))
            {
                onUndoDeletePartnerCompletedDelegate = new SendOrPostCallback(OnUndoDeletePartnerCompleted);
            }
            InvokeAsync(onBeginUndoDeletePartnerDelegate, new object[] {
                    objID}, onEndUndoDeletePartnerDelegate, onUndoDeletePartnerCompletedDelegate, userState);
        }

        private BeginOperationDelegate onBeginUndoDeletePartnerDelegate;

        private EndOperationDelegate onEndUndoDeletePartnerDelegate;

        private SendOrPostCallback onUndoDeletePartnerCompletedDelegate;

        private partial class InventoryServiceClientChannel
        {
            public IAsyncResult BeginUndoDeletePartner(int objID, AsyncCallback callback, object asyncState)
            {
                object[] _args = new object[1];
                _args[0] = objID;

                IAsyncResult _result = BeginInvoke("UndoDeletePartner", _args, callback, asyncState);
                return _result;
            }

            public Feedback EndUndoDeletePartner(IAsyncResult result)
            {
                object[] _args = new object[0];
                Feedback _result = ((Feedback)(EndInvoke("UndoDeletePartner", _args, result)));
                return _result;
            }
        }

        #endregion
        
    }
}
